<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>[%$softtitle%]</title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/formdiv.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var subjectmanage_type_add_mid  = "[%$ST.subjectmanage_type_add_mid%]";
	var subjectmanage_js_noselect_empty  = "[%$ST.subjectmanage_js_noselect_empty%]";
	var subjectmanage_js_subjectname_empty  = "[%$ST.subjectmanage_js_subjectname_empty%]";
	var subjectmanage_js_dirname_empty  = "[%$ST.subjectmanage_js_dirname_empty%]";
	var subjectmanage_js_template_empty  = "[%$ST.subjectmanage_js_template_empty%]";
	var subjectmanage_js_pagemax_empty  = "[%$ST.subjectmanage_js_pagemax_empty%]";
	var subjectmanage_js_type_edit_ok = "[%$ST.subjectmanage_js_type_edit_ok%]";
	var subjectmanage_js_type_edit_no = "[%$ST.subjectmanage_js_type_edit_no%]";
	var iframename = "[%$iframename%]";
	$(document).ready(function(){
		var h = '[%$iframeheightwindow%]';
		$('.managebottonadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse,
			resetForm: true
		};
		$('#subedit').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
		parent.scrolclear();
	})




	function formverify(formData) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['subjectname']==''){
			document.subedit.subjectname.focus();
			alert(subjectmanage_js_subjectname_empty);
			return false;
		}
		if(get['template'].match(/^[\w]+$/ig)==null || get['filenamestyle'].match(/^[\{\}\w-]+$/ig)==null) {
			document.subedit.template.focus();
			alert(subjectmanage_js_template_empty);
			return false;
		}
		if(get['pagemax']!='') {
			if(get['pagemax'].match(/^[0-9]+$/ig)==null) {
				document.subedit.pagemax.focus();
				alert(subjectmanage_js_pagemax_empty);
				return false;
			}
		}
		parent.windowsdig('Loading','iframe:index.php?archive=management&action=load','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			parent.frames[iframename].refresh('selectform','selectall','check_all');
			alert(subjectmanage_js_type_edit_ok);
		}else{
			alert(subjectmanage_js_type_edit_no);
		}
		parent.scrolopen();
		parent.onaletdoc()
	}
</script>
</head>

<body>
<form name="subedit" id="subedit" method="post" action="index.php?archive=subjectmanage&action=subsave">
<input type="hidden" name="inputclass" value="edit">
<input type="hidden" name="sid" value="[%$subread.sid%]">
<input type="hidden" name="lng" value="[%$subread.lng%]">
<input type="hidden" name="dirname" value="[%$subread.dirname%]">
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<!--查看已选择的类型-->
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">[%$ST.position_title%]</span><span class="colorgorningage">[%$ST.subjectmanage_type_edit_mess%] <u>[%$subread.subjectname%]</u></span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtable">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.subjectmanage_type_add_mid%]</td>
						<td width="85%" class="trtitle02 colorgblue">[%$model%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_dirname%]</td>
						<td width="85%" class="trtitle02 colorgblue">[%$subread.dirname%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.subjectmanage_type_add_dirpath%]</td>
						<td width="85%" class="trtitle02 colorgblue">[%$pathdir%][%if $is_alonelng!=1%][%$lngdir%]/[%/if%][%$subread.dirpath%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle011">[%$ST.subjectmanage_type_add_subjectname%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="subjectname" size="60" value="[%$subread.subjectname%]" maxlength="100" class="infoInput"/>
							<span class="cautiontitle">[%$ST.subjectmanage_type_add_subjectname_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.subjectmanage_type_add_subpic%]</td>
						<td width="85%" class="trtitle02">
							<ul class="addpiclist">
								[%if $subread.subpic!=''%]
								<li id="addsrlipic"><a title="[%$ST.remimages_botton%]" ondblclick="removerpic('addsrlipic','subpic')" href="#body"><p><img id="addsrcpic" src="[%$adminurl%][%$subread.subpic%]" width="100" height="100"></p></a></li>
								[%else%]
								<li id="addsrlipic"><a title="[%$ST.selectfile_botton%]" onclick="javascript:parent.windowsdig('[%$ST.filemanage_select_title%]','iframe:index.php?archive=filemanage&action=filewindow&listfunction=filelist&filetype=img&checkfrom=picshow&getbyid=addsrlipic&fileinputid=subpic&maxselect=1&iframename='+self.frameElement.getAttribute('name'),'900px','480px','iframe')" href="#body"><p><img id="addsrcpic" src="templates/images/pic.png" width="100" height="100"></p></a></li>
								[%/if%]

							</ul>
							<input type="hidden" name="subpic" id="subpic" value="[%$subread.subpic%]" size="50" maxlength="50" class="infoInput"/>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.subjectmanage_type_add_content%]</td>
						<td width="85%" class="trtitle02"><textarea name="content" cols="50" rows="5" class="smallInput" style="width:98%;height:70px;" >[%$subread.content|Html2Text('0')%]</textarea></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle03" colspan="2">[%$ST.article_doc_tab_title01%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.article_doc_add_headtitle%]</td>
						<td class="trtitle02"><input type="text" name="headtitle" id="headtitle" value="[%$subread.headtitle%]" maxlength="100" class="infoInput" style="width:98%;"/></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"></td>
						<td class="trtitle02">
							<a class="keyselect" href="#body" onclick="javascript:parent.windowsdig('[%$ST.selectkeytype_botton%]','iframe:index.php?archive=seomanage&action=listwindow&inputtext=keywords&listfunction=keytype&checkfrom=function&maxselect=1&mid=[%$subread.mid%]&iframename='+self.frameElement.getAttribute('name'),'850px','450px','iframe');">[%$ST.selectkeytype_botton%]</a>
							<a class="keyselect" href="#body" onclick="javascript:parent.windowsdig('[%$ST.selectkeyword_botton%]','iframe:index.php?archive=seomanage&action=listwindow&inputtext=keywords&listfunction=key&checkfrom=input&mid=[%$subread.mid%]&iframename='+self.frameElement.getAttribute('name'),'650px','380px','iframe');">[%$ST.selectkeyword_botton%]</a>
						</td>
					</tr>
					<tr class="trstyle3">
						<td class="trtitle01">[%$ST.article_doc_add_keywords%]</td>
						<td class="trtitle02">
							<input type="text" name="keywords" id="keywords" maxlength="100" class="infoInput" value="[%$subread.keywords%]" style="width:98%;"/>
						</td>
					</tr>
					<tr class="trstyle3">
						<td class="trtitle01">[%$ST.article_doc_add_description%]</td>
						<td class="trtitle02">
							<textarea name="description" id="description"  style="width:98%;height:50px;" class="smallInput">[%$subread.description%]</textarea>
						</td>
					</tr>

					<tr class="trstyle2">
						<td class="trtitle03" colspan="2">[%$ST.article_doc_tab_title03%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.subjectmanage_type_add_purview%]</td>
						<td width="85%" class="trtitle02">
							<select size="1" name="purview" id="purview">
								<option value="0">[%$ST.subjectmanage_type_add_purview_option%]</option>
								[%forlist from=$memberpuvlist key=list%]
								<option [%$memberpuvlist[list].selected%] value="[%$memberpuvlist[list].mcid%]">[%$memberpuvlist[list].rankname%]</option>
								[%/forlist%]
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_pageclass%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="ishtml" [%if $subread.ishtml==1%]checked="checked"[%/if%] onclick="showdiv(1,'#filenamestylediv','0|1','trstyle2 displaynone|trstyle2 displaytrue',1,0)"/> [%$ST.typemanage_type_add_pageclass_1%]&nbsp;
							<input type="radio" value="0" name="ishtml" [%if $subread.ishtml==0%]checked="checked"[%/if%] onclick="showdiv(0,'#filenamestylediv','0|1','trstyle2 displaynone|trstyle2 displaytrue',1,0)"/> [%$ST.typemanage_type_add_pageclass_0%]
							<span class="cautiontitle">[%$ST.typemanage_type_add_pageclass_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.subjectmanage_type_add_styleid%]</td>
						<td width="85%" class="trtitle02">
							<select size="1" name="styleid" id="styleid" onchange="showdiv(this.value,'#filenamestylediv|#pagemaxdiv','1|2','trstyle2 displaynone|trstyle2 displaytrue',1,1)">
								<option [%if $subread.styleid==2%]selected[%/if%] value="2">[%$ST.subjectmanage_type_add_styleid_2%]</option>
								<option [%if $subread.styleid==1%]selected[%/if%] value="1">[%$ST.subjectmanage_type_add_styleid_1%]</option>
							</select>
						</td>
					</tr>
					<tr class="trstyle2" id="templatediv">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_templateindex%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="indextemplates" id="indextemplates" size="20" maxlength="80" value="[%$subread.indextemplates%]" class="infoInput"/>
							<a class="filecheck" href="#body" onclick="javascript:parent.windowsdig('[%$ST.selecttempfile_botton%]','iframe:index.php?archive=templatemain&action=listwindow&inputtext=indextemplates&typeclass=article&skindir=&filedir=article&fileclass=&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),'750px','400px','iframe');">[%$ST.selecttempfile_botton%]</a>
							<span class="cautiontitle">[%$ST.typemanage_type_add_template_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.subjectmanage_type_add_template%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" id="subtemplatevalue" name="template" value="[%$subread.template%]" size="30" maxlength="80" class="infoInput"/>
							<a class="filecheck" href="#body" onclick="javascript:parent.windowsdig('[%$ST.selecttempfile_botton%]','iframe:index.php?archive=templatemain&action=listwindow&inputtext=subtemplatevalue&typeclass=article&skindir=&filedir=article&fileclass=&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),'750px','400px','iframe');">[%$ST.selecttempfile_botton%]</a>
							<span class="cautiontitle">[%$ST.subjectmanage_type_add_template_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2" id="pagemaxdiv">
						<td width="15%" class="trtitle01">[%$ST.subjectmanage_type_add_pagemax%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="pagemax" size="5" value="[%$subread.pagemax%]" maxlength="3" value="0" class="infoInput"/>
							<span class="cautiontitle">[%$ST.subjectmanage_type_add_pagemax_mess%]</span>
						</td>
					</tr>
					<tr id="filenamestylediv" [%if $subread.ishtml==1 && $subread.styleid==2%]class="trstyle2 displaytrue"[%else%]class="trstyle2 displaynone"[%/if%]>
						<td width="15%" class="trtitle01">[%$ST.subjectmanage_type_add_filenamestyle%]</td>
						<td width="85%" class="trtitle02">
							<select size="1" name="filenamestyle" id="filenamestyle">
								[%forlist from=$filetemplate key=list%]
								<option [%if $subread.filenamestyle==$filetemplate[list].id%]selected[%/if%] value="[%$filetemplate[list].id%]">[%$filetemplate[list].name%].[%$ext%]</option>
								[%/forlist%]
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle03" colspan="2">[%$ST.iswap_message%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.iswap_title%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="iswap" [%if $subread.iswap==1%]checked="checked"[%/if%]/> [%$ST.open_botton_title%]&nbsp;
							<input type="radio" value="0" name="iswap" [%if $subread.iswap==0%]checked="checked"[%/if%]/> [%$ST.close_botton_title%]
							<span class="cautiontitle">[%$ST.iswap_title_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.iswap_templates_file%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" id="waptempalte" name="waptempalte" size="30" maxlength="80" value="[%$subread.waptempalte%]" class="infoInput"/>
							<a class="filecheck" href="#body" onclick="javascript:parent.windowsdig('[%$ST.selecttempfile_botton%]','iframe:index.php?archive=templatemain&action=listwindow&inputtext=waptempalte&typeclass=article&skindir=wap&filedir=article&fileclass=&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),'750px','400px','iframe');">[%$ST.selecttempfile_botton%]</a>
							<span class="cautiontitle">[%$ST.subjectmanage_type_add_template_mess%]</span>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table border="0" width="100%">
			<tr>
				<td id="right"><input type="submit" name="Submit" value="[%$ST.botton_edit%]" class="button orange" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:closewindow();" value="[%$ST.botton_edit_reset%]" class="button orange" /></td>
			</tr>
		</table>
	</div>
</div>
</form>
</body>

</html>      